/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package plugin;

import Main.Parameters;
import system.MessageOUTPUT;

/**
 *
 * @author ZeM
 */
public class LibsThread implements Runnable {

    public String lib_name; // name of lib to load

    public void run() {
        int k = 0;
        boolean find_place_to_load = false;
        while (k < Parameters.RunningLibs.length & !find_place_to_load) {
            if (Parameters.RunningLibs[k] == null) {
                Parameters.RunningLibs[k] = lib_name;
                String[] mes= new String[1];
                mes[0]=lib_name;
                new MessageOUTPUT().OUTPUT("ev0007",mes);
                Parameters.Libs[k]=new SystemClassLoader();
                Parameters.Libs[k].Load(lib_name);
                Parameters.Libs[k].Start();
                find_place_to_load = true;
            } else {
                k++;
            }
        }
    }
}
